import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './assets/css/global.css'
import './assets/fonts/iconfont'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
Vue.config.productionTip = false

Vue.use(ElementUI)
// 配置请求的跟路径
axios.defaults.baseURL = 'http://localhost:9090/'
Vue.prototype.$http = axios
Vue.config.productionTip = false

//格式化日期
Vue.prototype.formatDate = function(val,type){
        var date = val
				var Y = date.getFullYear() + '-';
				var M = (date.getMonth()+1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
				var D = date.getDate() < 10 ? '0' + date.getDate(): date.getDate();
				var h = date.getHours() + ':';
				var m = date.getMinutes() + ':';
				var s = date.getSeconds();
        var df
        if(type == 1){
          df = Y+M+D;
        }
        else{
          df = Y+M+D+' '+h+m+s;
        }
				return df;
}
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
